<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>店铺列表</title>
    <script type="text/javascript" src="/admin/qrcode/jq.js"></script>
    <script type="text/javascript" src="/admin/qrcode/bot.js"></script>
    <link rel="stylesheet" type="text/css" href="/admin/css/boot.css"></link>
    <link rel="stylesheet" type="text/css" href="/admin/css/sl.css"></link>
    <style>
        span {
            color: #1EABFF;
            padding: 0 5px;
        }
    </style>
</head>
<body>
<h2>店铺信息</h2>
<form id="myForm" class="form-horizontal">
    <div class="form-group">
        <label class="col-sm-1 control-label">店铺图片</label>
        <div id="picture" name="picture" class="col-sm-9">

        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">店铺名称</label>
        <div  class="col-sm-9">
            <input id="spencerUser" style="width: 300px" required="required" disabled  name="spencerUser" class="form-control"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">店主手机号</label>
        <div class="col-sm-9">
            <input id="phone" style="width: 300px"  name="phone" class="form-control" disabled/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">地址</label>
        <div class="col-sm-9">
            <input id="location" style="width: 300px" name="location"  class="form-control" disabled/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">店主姓名</label>
        <div class="col-sm-9">
            <input id="userName" style="width: 300px" name="userName" class="form-control" disabled/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">注册时间</label>
        <div class="col-sm-9">
            <input id="createTime" style="width: 300px" name="createTime" class="form-control" disabled/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label"></label>
        <div class="col-sm-9">
            <button id="btn1" type="button" class="btn btn-sm btn-info">修&nbsp;改</button>
        </div>
    </div>
</form>
</body>

</html>
<script>
    let btn1 = document.getElementById('btn1')
    let id;
    $(function () {
        $.ajax({
            type: "post",
            url: "/Spencer/selectKeySpencer",
            data: "",
            dataType:"json",
            success: function(vo){
                var spencerName = vo.spencerName;
                $("input[name='spencerUser']").val(spencerName);
                var userName = vo.userName;
                $("input[name='userName']").val(userName);
                var phone = vo.phone;
                var createTime = vo.createTime;
                var picture=vo.picture===''?'<button type="button" name="updateBtn" class="btn btn-sm btn-info" onclick="uploadLogo()">添加图片</button>':
                    '<img width="100px" height="67px"  src="/assets/images/spencer/'+vo.picture+'">&nbsp;<button type="button" name="updateBtn" class="btn btn-sm btn-info" onclick="uploadLogo()">修改图片</button>';
                var location = vo.location;
                $("input[name='spencerUser']").val(spencerName);
                $("input[name='userName']").val(userName);
                $("input[name='phone']").val(phone);
                $("input[name='createTime']").val(createTime);
                $("input[name='location']").val(location);
                $("#picture").html(picture);
                id = vo.spencerId;
            }
        });
    });
    function uploadLogo() {
        window.location.href="uploadLogo.html";
    }
    btn1.onclick = function (){
        window.location.href = "update.html";
    }
</script>
